var a = getApp(), t = void 0;

Page({
    data: {
        list: [],
        total: 0,
        ing: []
    },
    onLoad: function(a) {
        t = this;
    },
    onShow: function() {
        t.getList(0);
    },
    getList: function(d) {
        0 == d ? this.data.currentPage = 1 : this.data.currentPage += 1, wx.showLoading({
            title: "加载中"
        }), a.com.post("wx/order/list", {
            pageSize: this.data.pageSize,
            currentPage: this.data.currentPage,
            tagFlag: this.data.tagFlag
        }, function(a) {
            wx.stopPullDownRefresh(), wx.hideLoading();
            for (var d in a.data.data.data) "nearby" != a.data.data.data[d].start_address && (a.data.data.data[d].start_address = JSON.parse(a.data.data.data[d].start_address)), 
            a.data.data.data[d].end_address = JSON.parse(a.data.data.data[d].end_address);
            for (var s in a.data.ing) a.data.ing[s].start_address = JSON.parse(a.data.ing[s].start_address), 
            a.data.ing[s].end_address = JSON.parse(a.data.ing[s].end_address);
            0 === a.errno && t.setData({
                list: a.data.data.data,
                total: a.data.data.count,
                ing: a.data.ing
            });
        });
    },
    onReachBottom: function() {
        this.data.list.length < this.data.total && this.getList(1);
    }
});